using UnityEngine;

public class BankAdditionalMoney : MonoBehaviour
{
	[SerializeField]
	private UILabel amountLabel;

	[SerializeField]
	private GameObject goldIcon;

	[SerializeField]
	private GameObject cashIcon;

	public void SetAdditionalMoney(int amount, bool cash)
	{
		goldIcon.SetActive(false);
		cashIcon.SetActive(false);
		amountLabel.gameObject.SetActive(false);
		if (amount > 0)
		{
			if (cash)
			{
				goldIcon.SetActive(true);
			}
			else
			{
				cashIcon.SetActive(true);
			}
			amountLabel.gameObject.SetActive(true);
			amountLabel.text = "+" + amount;
			if (amountLabel.transform.parent == base.transform)
			{
				amountLabel.transform.SetParent(base.transform.parent);
			}
		}
	}

	public void SetAdditionalMoneyAlternative(int cashAmountAlternative, int goldAmountAlternative, InAppProduct inAppProduct)
	{
		goldIcon.SetActive(false);
		cashIcon.SetActive(true);
		amountLabel.gameObject.SetActive(cashAmountAlternative >= 0);
		amountLabel.text = "+" + cashAmountAlternative;
		if (amountLabel.transform.parent == base.transform)
		{
			amountLabel.transform.SetParent(base.transform.parent);
		}
		inAppProduct.SetlbGiveCoins(goldAmountAlternative);
	}
}
